package com.springcloud.demo.dao;

import com.springcloud.demo.model.Demo;
import com.xframework.Base;
import com.xframework.dao.BaseDao;
import com.xframework.model.SqlParamSeg;
import com.xframework.model.SqlParams;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

@Repository
public class DemoDao extends BaseDao implements SQL {

    public List<Demo> selectDemoList(Demo demo) throws Exception {
        SqlParams sqlParams = new SqlParams(
                selectDemoListSql,
                demo,
                new SqlParamSeg("and t1.demo_id = ?", demo.getDemoId())
        );
        return this.queryForList(sqlParams);
    }

}
